<template>
	<mylog ref="mylog" @ok="ok" @close="cancel">
		<template #center>
			<el-form  ref="form" :model="form" :rules="rules" label-width="300px" label-position="top" :disabled="showBtn">
				<el-row :gutter="20">
					<el-col :span="spanNumber">
						<el-form-item label="任务名称" prop="nodeName">
							<el-input v-model="form.nodeName" placeholder="请输入任务名称" />
						</el-form-item>
					</el-col>
					<el-col :span="spanNumber">
						<el-form-item label="任务描述" prop="nodeRemark">
							<el-input v-model="form.nodeRemark" placeholder="请输入任务描述" />
						</el-form-item>
					</el-col>
					<!-- <el-col :span="spanNumber">
						<el-form-item label="任务分数" prop="nodeNumber">
							<el-input-number v-model="form.nodeNumber" style="width: 100%;" placeholder="请输入任务分数" />
						</el-form-item>
					</el-col> -->
					<el-col :span="spanNumber">
						<el-form-item label="任务备注" prop="remark">
							<el-input v-model="form.remark" type="textarea" placeholder="请输入任务内容" />
						</el-form-item>
					</el-col>
					<!-- <el-col :span="24">
						<el-form-item label="任务内容" prop="noticeContent">
							<editor v-model="form.noticeContent" :min-height="250" />
						</el-form-item>
					</el-col> -->
				</el-row>
			</el-form>
		</template>
	</mylog>
</template>

<script>
	import {
		getAction,
		postAction,
		editAction,
		removeAction,
		detailAction,
	} from "@/api/api";
	import mylog from '@/views/components/mylog.vue'
	export default {
		dicts: [],
		components: {
			mylog,
		},
		name: "renwu",
		data() {
			return {
				showBtn:false,
				spanNumber: 24,
				form: {},
				rules: {
					nodeName: [{
						required: true,
						message: '请输入任务名称',
						trigger: 'blur'
					}],
					nodeRemark: [{
						required: false,
						message: '请输入任务描述',
						trigger: 'blur'
					}],
					nodeNumber: [{
						required: true,
						message: '请输入任务分数',
						trigger: 'blur'
					}],
					remark: [{
						required: false,
						message: '请输入任务内容',
						trigger: 'blur'
					}],
					noticeContent: [{
						required: true,
						message: '请输入内容',
						trigger: 'blur'
					}],


				},
			};
		},
		created() {},
		methods: {
			ok() {
				console.log(this.form)
				this.$refs.form.validate((valid) => {
					if (valid) {
						this.$emit('ok', this.form)
						this.form = {}
						this.$refs.mylog.cancel()
					} else {
						this.$refs.mylog.loading = false
					}
				});
			},
			cancel() {
				this.form = {}
				this.open = false;
				this.title = null
			}
		}
	};
</script>
<style scoped lang="scss">
	.title-box {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 30px;

		>span {
			font-weight: 500;
			font-size: 18px;
			line-height: 30px;
		}

	}

	.center-box {

		height: calc(100% - 60px);
	}
</style>